package com.edu.study.base.stuQuestionPaperRelation.service.impl;

import com.edu.study.base.stuQuestionPaperRelation.domain.StuQuestionPaperRelation;
import com.edu.study.base.stuQuestionPaperRelation.mapper.StuQuestionPaperRelationMapper;
import com.edu.study.base.stuQuestionPaperRelation.service.IStuQuestionPaperRelationService;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 题卷和题库的关系Service业务层处理
 * 
 * @author jjt
 * @date 2021-05-29
 */
@Service
public class StuQuestionPaperRelationServiceImpl implements IStuQuestionPaperRelationService 
{
    @Autowired
    private StuQuestionPaperRelationMapper stuQuestionPaperRelationMapper;

    /**
     * 查询题卷和题库的关系
     * 
     * @param id 题卷和题库的关系ID
     * @return 题卷和题库的关系
     */
    @Override
    public StuQuestionPaperRelation selectStuQuestionPaperRelationById(Long id)
    {
        return stuQuestionPaperRelationMapper.selectStuQuestionPaperRelationById(id);
    }

    /**
     * 查询题卷和题库的关系列表
     * 
     * @param stuQuestionPaperRelation 题卷和题库的关系
     * @return 题卷和题库的关系
     */
    @Override
    public List<StuQuestionPaperRelation> selectStuQuestionPaperRelationList(StuQuestionPaperRelation stuQuestionPaperRelation)
    {
        return stuQuestionPaperRelationMapper.selectStuQuestionPaperRelationList(stuQuestionPaperRelation);
    }

    /**
     * 新增题卷和题库的关系
     * 
     * @param stuQuestionPaperRelation 题卷和题库的关系
     * @return 结果
     */
    @Override
    public int insertStuQuestionPaperRelation(StuQuestionPaperRelation stuQuestionPaperRelation)
    {
        stuQuestionPaperRelation.setCreateTime(DateUtils.getNowDate());
        return stuQuestionPaperRelationMapper.insertStuQuestionPaperRelation(stuQuestionPaperRelation);
    }

    /**
     * 修改题卷和题库的关系
     * 
     * @param stuQuestionPaperRelation 题卷和题库的关系
     * @return 结果
     */
    @Override
    public int updateStuQuestionPaperRelation(StuQuestionPaperRelation stuQuestionPaperRelation)
    {
        return stuQuestionPaperRelationMapper.updateStuQuestionPaperRelation(stuQuestionPaperRelation);
    }

    /**
     * 批量删除题卷和题库的关系
     * 
     * @param ids 需要删除的题卷和题库的关系ID
     * @return 结果
     */
    @Override
    public int deleteStuQuestionPaperRelationByIds(Long[] ids)
    {
        return stuQuestionPaperRelationMapper.deleteStuQuestionPaperRelationByIds(ids);
    }

    @Override
    public int deleteStuQuestionPaperRelationBylibraryIds(String[] ids) {
        return stuQuestionPaperRelationMapper.deleteStuQuestionPaperRelationBylibraryIds(ids);
    }

    /**
     * 删除题卷和题库的关系信息
     * 
     * @param id 题卷和题库的关系ID
     * @return 结果
     */
    @Override
    public int deleteStuQuestionPaperRelationById(Long id)
    {
        return stuQuestionPaperRelationMapper.deleteStuQuestionPaperRelationById(id);
    }
}
